#include "x2tk_Widget.h"
#include "RawVector.h"
#include "fontSDL.h"

#ifndef X2TK_VTEXT_H
#define X2TK_VTEXT_H

namespace x2tk {

class VText : public Widget{
  private:
    RawVector< RawVector<char> > lineList_;
    unsigned topLine_;
    unsigned left_;
    Font font_;
    unsigned crow_, ccol_;
    bool showCursor_;
    
    bool autoIndent_;
    
    RawVector<char> newLine() {
      RawVector<char> line;
      line.add(0); return line;
    }
    
    void fcursor();
  public:
    VText(int x, int y, int w, int h);
    virtual void draw(GraphicContext &g);
    virtual void event_key(const SDL_KeyboardEvent& key);
    virtual bool mouseDown(int type);
    void load(const char *path);
    ~VText();
};

} // namespace x2tk

#endif
